package com.baizhiedu.action;

import com.baizhiedu.entity.User;
import com.baizhiedu.service.UserService;
import com.opensymphony.xwork2.Action;

/**
 * ClassName: RegAction
 * Description:
 * Date: 2022/11/24 PM 3:38:40
 * <p>
 * project: spring5
 * package: com.baizhiedu.action
 * email: 1085844536@qq.com
 * version:
 *
 * @author WangGuojian
 */
public class RegAction implements Action {
    private UserService userService;

    private User user;

    public User getUser() {
        return user;
    }

    public void setUser(User user) {
        this.user = user;
    }

    public UserService getUserService() {
        return userService;
    }

    public void setUserService(UserService userService) {
        this.userService = userService;
    }

    @Override
    public String execute() throws Exception {
        userService.register(user);
        return Action.SUCCESS;
    }
}
